/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BusinessLogic;
import DataAccess.*;
import javax.swing.JOptionPane;
/**
 *
 * @author thangvv0907i
 */
public class Connect {

    public boolean ConnectDB() {
        ConfigFile.loadConfigurations();
        if (!ConnectionDB.connect(ConfigFile.getProperty(ConfigFile.CONFIG_SERVERNAME),
                ConfigFile.getProperty(ConfigFile.CONFIG_PORTNUMBER),
                ConfigFile.getProperty(ConfigFile.CONFIG_SERVERUSERNAME),
                ConfigFile.getProperty(ConfigFile.CONFIG_SERVERPASSWORD),
                ConfigFile.getProperty(ConfigFile.CONFIG_DATABASENAME))) {
            JOptionPane.showMessageDialog(null, "Cannot connect to server");
            return false;
        }
    return true;
    }
}
